
/* 一键回到顶部 */
let returnTop = document.createElement("img");
returnTop.setAttribute("class", "to-top");
returnTop.setAttribute(
	"src",
	"https://imgbdb4.bendibao.com/whbdb/20233/27/2023327165943_55839.png"
);
document.body.appendChild(returnTop);
returnTop.onclick = toTop;
returnTop.style.cssText =
	"display:none;position: fixed;right: 3%;bottom: 20%;width: 40px;height: 40px;z-index:1000;cursor: pointer;";

window.onscroll = function () {
	let t = document.documentElement.scrollTop || document.body.scrollTop;
	if (t >= 700) {
		returnTop.style.display = "inline";
	} else {
		returnTop.style.display = "none";
	}
};

function toTop() {
	$("html,body").animate({ scrollTop: 0 }, "slow");
}
